<?php
/*
	首页
*/

defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
if($_RQ['op']=='main'){
	$return=model('jy_weishop/page/index')->getmain($return);
	$sharelink='jy_newcar/index//fromuser='.$_SESSION['uid'];
	$return['sharedata']['link']=custom_url($sharelink,true);
	$page=cfc('core')->get_page_keywords('jy_weishop','index',true);
	if($_SESSION['os']=='windows'){
		set_html('title',$page['title']?:$return['sharedata']['title']);
		set_html('description',$page['description']?:$return['sharedata']['desc']);
	}else{
		set_html('title',$return['shopset']['title']?:'首页-在线商城');
	}
	$return['storeid']=$_SESSION['store_id'];
	$return['setting']=$return['pluginset'];
	$return['htmls']='';
	set_html('keywords',$page['keywords']?:$return['setting']['share_keywords']);
	exi($return);
}
if($_RQ['op']=='getpcd'){
	if(!empty($_RQ['keyword'])){
			$params['title like']='%'.$_RQ['keyword'].'%';
			$return['params']['title']=$_RQ['keyword'];
	}
	$areas=cfc('area')->get_pcd_titlelist($_RQ['keyword']);
	$return['areas']=$areas;
	exi($return);
}
if($_RQ['op']=='uppcd'){
	$post=get_postdata();
	if($post['lat'] || $post['lng']){
		$lat_lng=array('lat'=>$post['lat'],'lng'=>$post['lng']);
		$this->session('lat_lng',$lat_lng);
	}
	$this->session('pcd',$post);
	//print_r($this->session('pcd'));exit;
	exi('更新成功！');
}
?>